Skip to content

Add stream_socket_client’s stub#3846

Closed
MatTheCat wants to merge 1 commit intophpstan:2.1.xfrom
MatTheCat:stream_socket_client-stub
Closed

Add stream_socket_client’s stub#3846
MatTheCat wants to merge 1 commit intophpstan:2.1.xfrom
MatTheCat:stream_socket_client-stub

Conversation

@MatTheCat
Copy link
Copy Markdown

Comment thread stubs/core.stub
* @param int $error_code
* @param-out int $error_code
* @param string $error_message
* @param-out string $error_message
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these set to if the call does not fail?

Copy link
Copy Markdown
Author

@MatTheCat MatTheCat Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$error_code will be zero and $error_message an empty string.

$ php -r 'var_dump(stream_socket_client("udp://127.0.0.1:13", $errorCode, $errorMessage), $errorCode, $errorMessage);'
resource(5) of type (stream)
int(0)
string(0) ""

EDIT it seems you can get those values even if the call fails: https://3v4l.org/TmSQQ

@MatTheCat
Copy link
Copy Markdown
Author

@ondrejmirtes I’m not sure what changes you requested?

@MatTheCat MatTheCat closed this Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stream_socket_client reference arguments’ type are ignored

2 participants